[mirrors]
http://www.hping.org/hping3-20051105.tar.gz

[vars]
filesize=584001
sha512=3b3faa836e70054c8f9f004d876b7eb5f668b64826a6aaf8ca3685619111d9df4eb494a7d38b83cea6cb5f0bd164956461039bf4f73f7c7e90d80cede639b2b3

[deps]
tcl
libpcap

[build]
patch -p1 < "$K"/hping2-endian.patch

sed -i 's@net/bpf.h@pcap/bpf.h@g' libpcap_stuff.c script.c
sed -i 's@-L/usr/local/lib@@g' Makefile.in
sed -i 's@./hping3 -v@true@g' Makefile.in

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

export CC="$CC -D_GNU_SOURCE $optcflags $optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib"
./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags
endian=__LITTLE_ENDIAN_BITFIELD
[ $("$K"/endiancheck.sh) = "big" ] &&  endian=__BIG_ENDIAN_BITFIELD
printf "#define %s\n" "$endian" > byteorder.h

#[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"

make V=1 -j$MAKE_THREADS CC="$CC"
install -D -m 755 hping3 "$butch_install_dir""$butch_prefix"/sbin/hping3
install -D -m 644 docs/hping3.8 "$butch_install_dir""$butch_prefix"/share/man/man8/hping3.8
